﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Nova_DAL;
using Nova_Common;
using System.Data.Common;

public partial class Control_getWeightSize : System.Web.UI.UserControl
{
    DbHelper access = new DbHelper();
    DbCommand cmd = null;
    DataSet ds = null;
    string strSQL = "";

    private string _sWeight = "";
    private string _sSize = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        _sWeight = ddlWeight.SelectedValue.ToString();
        _sSize = ddlSize.SelectedValue.ToString();
        if (!IsPostBack)
        {
            ddlbind();
        }
    }

    protected void ddlbind()
    {
        strSQL = "SELECT Pos_Weight,Pos_Weight_Title FROM TWeightDefineMain ORDER BY PID ";
        cmd = access.GetSqlStringCommond(strSQL);
        ds = access.ExecuteDataSet(cmd);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlWeight.DataSource = ds.Tables[0].DefaultView;
            ddlWeight.DataBind();
            ddlWeight.Items.Insert(0, new ListItem("重量选择", "-1"));
        }


        strSQL = "SELECT Pos_Size,SizeTitle FROM TSizeDefineMain ORDER BY PID ";
        cmd = access.GetSqlStringCommond(strSQL);
        ds = access.ExecuteDataSet(cmd);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlSize.DataSource = ds.Tables[0].DefaultView;
            ddlSize.DataBind();
            ddlSize.Items.Insert(0, new ListItem("尺寸选择", "-1"));
        }
    }


    public string sWeight
    {
        get
        {
            return _sWeight;
        }
        set
        {
            _sWeight = value;
        }
    }
    public string sSize
    {
        get
        {
            return _sSize;
        }
        set
        {
            _sSize = value;
        }
    }
    
}
